/*
 * @Author: wwssaabb
 * @Date: 2021-07-05 09:57:33
 * @LastEditTime: 2021-07-05 10:02:50
 * @FilePath: \demo\koa2_demo\demo\连mongodb接数据库增删改查_demo\mongodb\model\user.js
 */

const mongoose=require('mongoose')

module.exports=mongoose.model('users',new mongoose.Schema({
  name:{
    type:String,
    required:true,
    minlength:2,
    maxlength:20
  },
  age:{
    type:Number,
    min:18,
    max:80,
  },
  hobbies:[String],
  email:String,
  password:String
}))
